#include "analy/branch/ToolBranchRF.h"

ToolBranchRF::ToolBranchRF(){

    QFont roofFont("KaiTi", 10);

    definfc.batchFont({TR_actionBut, FL_fileaddBut, AS_assistBut, SP_serialBut, VW_viewcutBut}, roofFont, 10);
    definfc.batchFont({TR_actionMenu, FL_actionMenu, AS_actionMenu, VW_actionMenu, SP_configMenu}, roofFont, 10);

    TR_actionBut->setText("线程操作");
    TR_actionBut->setPopupMode(QToolButton::InstantPopup);
    FL_fileaddBut->setText("文件添加");
    FL_fileaddBut->setPopupMode(QToolButton::InstantPopup);
    AS_assistBut->setText("辅助功能");
    SP_serialBut->setPopupMode(QToolButton::InstantPopup);
    SP_serialBut->setText("串口设置");
    AS_assistBut->setPopupMode(QToolButton::InstantPopup);
    VW_viewcutBut->setText("<解析工具>");

    TR_actionMenu->addAction(TR_PauseAC);
    TR_actionMenu->addSeparator();
    TR_actionMenu->addAction(TR_RecoverAC);
    TR_actionMenu->addSeparator();
    TR_actionMenu->addAction(TR_WipeAC);
    TR_actionMenu->addSeparator();
    TR_actionMenu->addAction(TR_OpfireAC);
    TR_actionMenu->addSeparator();
    TR_actionBut->setMenu(TR_actionMenu);

    FL_actionMenu->addAction(FL_sgfileAC);
    FL_actionMenu->addSeparator();
    FL_actionMenu->addAction(FL_folderAC);
    FL_actionMenu->addSeparator();
    FL_fileaddBut->setMenu(FL_actionMenu);

    AS_actionMenu->addAction(AS_pasteAC);
    AS_actionMenu->addSeparator();
    AS_actionMenu->addAction(AS_rscopyAC);
    AS_actionMenu->addSeparator();
    AS_actionMenu->addAction(AS_cpcolumnAC);
    AS_actionMenu->addSeparator();
    AS_actionMenu->addAction(AS_numputAC);
    AS_actionMenu->addSeparator();
    AS_actionMenu->addMenu(AS_listMode);
    AS_actionMenu->addSeparator();
    AS_actionMenu->addMenu(AS_TableView);

    AS_listMode->setObjectName("AS1");
    AS_multiAC->setObjectName("AS2");
    AS_singleAC->setObjectName("AS3");
    AS_continueAC->setObjectName("AS4");
    AS_pasteAC->setObjectName("AS5");
    AS_rscopyAC->setObjectName("AS6");
    AS_cpcolumnAC->setObjectName("AS7");
    AS_numputAC->setObjectName("AS8");
    AS_TableView->setObjectName("AS9");
    As_cpviewAC->setObjectName("AS10");
    As_xmviewAC->setObjectName("AS11");

    FL_sgfileAC->setObjectName("FL1");
    FL_folderAC->setObjectName("FL2");
    TL_AnlyAC->setObjectName("VW1");
    TL_QrcodeAC->setObjectName("VW2");
    TL_SerialAC->setObjectName("VW3");
    TR_PauseAC->setObjectName("TR1");
    TR_RecoverAC->setObjectName("TR2");
    TR_WipeAC->setObjectName("TR3");
    TR_OpfireAC->setObjectName("TR4");
    SP_taBarSwcAC->setObjectName("SP1");


    AS_listMode->addAction(AS_multiAC);
    AS_listMode->addSeparator();
    AS_listMode->addAction(AS_singleAC);
    AS_listMode->addSeparator();
    AS_listMode->addAction(AS_continueAC);

    AS_TableView->addAction(As_cpviewAC);
    AS_TableView->addSeparator();
    AS_TableView->addAction(As_xmviewAC);

    SP_configMenu->addAction(SP_taBarSwcAC);

    VW_actionMenu->addAction(TL_AnlyAC);
    VW_actionMenu->addSeparator();
    VW_actionMenu->addAction(TL_QrcodeAC);
    VW_actionMenu->addSeparator();
    VW_actionMenu->addAction(TL_SerialAC);

    TR_actionBut->setMenu(TR_actionMenu);
    FL_fileaddBut->setMenu(FL_actionMenu);
    AS_assistBut->setMenu(AS_actionMenu);
    SP_serialBut->setMenu(SP_configMenu);
    VW_viewcutBut->setMenu(VW_actionMenu);

    LeftMenuHbox->addWidget(TR_actionBut);
    LeftMenuHbox->addWidget(FL_fileaddBut);
    LeftMenuHbox->addWidget(AS_assistBut);
    LeftMenuHbox->addWidget(SP_serialBut);
    LeftMenuHbox->addWidget(VW_viewcutBut);
    LeftMenuHbox->setContentsMargins(5, 0, 0, 0);
    LeftMenuHbox->setSpacing(2);
    RoofWidget->setContentsMargins(0, 0, 0, 0);
    GlobalRoofGrid->setContentsMargins(0, 0, 0, 0);
    GlobalRoofGrid->addLayout(LeftMenuHbox, 0, 0, 2, 1, Qt::AlignLeft);
    RoofWidget->setLayout(GlobalRoofGrid);
}












